package com.kuaiyin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.kuaiyin.enums.Status;
import com.kuaiyin.sampling.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>
 * 用户基础信息表（使用逻辑外键）
 * </p>
 *
 * @author ng
 * @since 2025-04-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "user")
@Schema(name = "User", description = "用户基础信息表（使用逻辑外键）")
public class User extends BaseEntity implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "登录账号（唯一）")
    private String username;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "所属部门ID（逻辑外键，关联department.id）")
    private Integer departmentId;


    @Schema(description = "手机号（唯一）")
    private String phone;

    @Schema(description = "邮箱（唯一）")
    private String email;

    @Schema(description = "状态：0-禁用 1-启用")
    private Status status;

}